package models;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class User {
    
    private String name;
    private String login;
    private String ip;
    private int    port;

    public User(String name, String login) {
        this.name = name;
        this.login = login;
        
        try {
            this.ip = InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException ex) {
            System.err.println("[Error] On User Project:");
            System.err.println("[models/User] Could not get IP address!");
            this.port= port;
        }
    }
    public String getName() {
        return name;
    }
    public String getLogin() {
        return login;
    }
    public String getIp() {
        return ip;
    }
    public int getPort(){
        return port;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setLogin(String login) {
        this.login = login;
    }
    public void setIp(String ip) {
        this.ip = ip;
    }
    public void setPort(int port){
        this.port = port;
    }
    public User (String name, String login, String ip) {
        this.name = name;
        this.login = login;
        
        try {
            this.ip = InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException ex) {
            System.err.println("[Error] On User Project:");
            System.err.println("[models/User] Could not get IP address!");
        }
        
    }
}